z(n:b)=unwords[x|x<-b,y<-[1..read n]];main=interact$reverse.z.words